package shop.exception;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import shop.entity.ResponseMessage;

@RestControllerAdvice
public class ExceptionHandleAdvice {
    @ExceptionHandler(Exception.class)
    public ResponseMessage<Object> handleException(Exception e) {
        System.out.println(e.getMessage());
        return ResponseMessage.error(500,"服务器错误");
    }
}
